drop table coll_board
create table coll_board(
   c_no number primary key,
   c_title varchar2(100) not null,
   c_content varchar2(3000) not null,
   c_date date not null,
   c_hit number default 0,
   c_like number default 0,
   ref number not null,
   restep number not null,
   relevel number not null,
   m_id varchar2(50) not null,
   constraint m_id_fk1 foreign key (m_id) references uri_member(m_id) on delete cascade
)
create sequence c_no_seq

insert into COLL_BOARD(c_no,c_title,c_content,c_date,ref,restep,relevel,m_id)
values(c_no_seq.nextval,'안녕','첫글입니다.',sysdate,1,0,0,'java');

drop table coll_file_attachment
create table coll_file_attachment(
	f_no number primary key,
	c_no number not null,
	m_id varchar2(50) not null,
	orgfilename varchar2(100) not null,
	newfilename varchar2(100) not null,
	constraint m_id_fk2 foreign key (m_id) references uri_member(m_id) on delete cascade,
	constraint textno_fk1 foreign key (c_no) references coll_board(c_no)
)
create sequence coll_file_seq

create sequence comment_no_seq;
drop table collection_comment;
create table collection_comment(
	comment_no number primary key,
	comment_comment varchar2(1000) not null,
	comment_date date not null,
	m_id varchar2(50) not null,
	c_no number not null,
	constraint collection_comment_fk_m_id foreign key (m_id) references uri_member(m_id) on delete cascade,
	constraint collection_comment_fk_c_no foreign key (c_no) references coll_board(c_no) on delete cascade
)

